<?php js_validate();?>
<form id="form-validated" class="input" action="<?php echo $own_links;?>save" method="post">
		<input type="hidden" name="position_id" id="position_id" value="<?php echo isset($val->position_id)?$val->position_id:'';?>" />
		<table class="table-form">
			<tr>
				<td>Kode Posisi</td>
				<td><input type="text" id="position_code" name="position_code" maxlength="3" class="validate[required,length[0,3],ajax[ajaxPosition]]"size="10" value="<?php echo isset($val->position_code)?$val->position_code:'';?>" /></td>
			</tr>
			<tr>
				<td>Departemen</td>
				<td>
					<select name="dept" class="validate[required]" id="dept">
						<option value="">Pilih Departemen</option>
						<?php
						if(count($dept['data'])>0){
							foreach($dept['data'] as $r){
								$t = isset($val->position_dept_id)?$val->position_dept_id:"";
								$s = ($r->dept_id==$t)?"selected='selected'":'';
								echo "<option value='".$r->dept_id."' $s >".$r->dept_code." > ".$r->dept_name."</option>";
							}
						}
						?>
					</select>
				</td>
			</tr>	
			<tr valign="top">
				<td>Penejlasan Posisi</td>
				<td><textarea id="position_desc" name="position_desc" rows="3" cols="50" class="validate[required]"><?php echo isset($val->position_desc)?$val->position_desc:'';?></textarea></td>
			</tr>	
			<tr><td colspan="2">&nbsp;</td></tr>
			<tr>
				<td><input type="reset" onclick="document.location='<?php echo $own_links;?>'" class="btnbatal" value="Batal" /></td>
				<td align="right"><input type="submit" class="btnsimpan" value="Simpan" /></td>
			</tr>
		</table>
	</form>